<?php ob_start(); ?> 
<?php header ('Content-type: text/xml; charset=utf-8'); ?>     

<?php include "constants.inc" ?>

<?php session_start(); ?> 

<?php

function keyInUse($q) {



	if (isset($q) && is_numeric($q) == true) {

        mysql_connect(DB_SERVER, DB_USER, DB_PWD);

		mysql_select_db(DB_CATALOG);

	    $result = mysql_query("SELECT COUNT(1) as keyExists FROM playernew WHERE matricule = ".$q);

        $row = mysql_fetch_assoc($result);

		$keyExists = $row['keyExists'];

		return $keyExists;

	}



    return '0';

}

?>

<response>

  <method>checkKey</method>

  <result><?php

    echo keyInUse($_GET['q']) ?>

  </result>

</response>